
<script type="text/javascript">
 $(function(){
 	$("#selcate").change(function(){
		var cate = $(this).val();
		 var datas = {
            cate: cate
           
        };
        var url = "{:U('Content/selectcate')}";
		
		$.post(url,{cate: cate , ajax : 1} ,function handel(res){

		// 遍历object属性
		var str = '';
		for (var i in res) { 
			 for(var j=1; j<res[i]['level']; j++){
			 	str +=  '&nbsp;&nbsp;&nbsp;&nbsp;';
			 }
			 str += "<input type='checkbox' name='checkbox_cate[]' value= " + res[i]['id']+ " />"+res[i]['name']+"<br />";
								
		}
		$("#checates").html(str);
	  
		} );
		
      
	});
 });
 
</script>
<div class="pageContent">
    <form method="post" id="Content_insert" action="{:U('Content/bindcate',array('proid'=>$proid))}" class="pageForm" onsubmit="return validateCallback(this, dialogAjaxDone)">
        <div class="pageFormContent" layoutH="52">
            <div class="tabs" currentIndex="0" eventType="click">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">
                        <ul>
                            <li><a href="javascript:;"><span>选择分类</span></a></li>                     
                        </ul>
                    </div>
                </div>
                <div class="tabsContent" layoutH="82">
                        <div id="product_attr">

                        <fieldset>
                            <legend>
                                产品添加属性
                            </legend>
                            <div id="urls">
                            </div>
                            <dl class="nowrap">
                                <div class="tabs" currentIndex="0" eventType="click">
                                    <div class="tabsHeader">
                                        <div class="tabsHeaderContent">
                                            <ul>
                                                <volist name="modelname" id="mn">
                                                    <li>
                                                        <a href="javascript:;"><span>{$mn['title']}</span></a>
                                                    </li>
                                                </volist>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="tabsContent" layoutH="82">
                                       
									 <volist name="modelname" id="mn">
									    <div id="attrgroup_{$mn['value']}">
									    	
                               
                             
                                 
                                    <volist name='groupattr' id='gattr' key='key_num'>
                                        {if $gattr['modelname'] == $mn['value']}
										<fieldset>
                                            <legend>
                                                <input type='checkbox' class='checkall' idnum='{$key_num}' />{$gattr.name} 
												<a id = "addattr" title="自定义属性" href="{:U('Content/addattr',array('gid'=>$gattr['id']))}" target="dialog" width="600" height="350"    ><span>++</span></a>
												
                                            </legend>
                                            <div>
                                                <volist name='gattr.attrs' id='attr'>
                                                    <input name='attrs[]' type='checkbox' class='chpro_{$key_num}' {if $proattr[$attr['id']]}checked='checked'{/if}  value='{$attr.id}' />
                                                    {$attr.value}

 &nbsp;&nbsp;
                                                </volist>
                                            </div>
                                        </fieldset>
										{/if}
                                    </volist>
                               
                                    </div>
									</volist>
                                  
                                </div>
                                </div>
                             
                            </dl>
                        </fieldset>
                    </div>
                  
                </div>
				
				
            </div>
        </div>
	<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
					</li>
				</ul>
			</div>		
    </form>
</div>
